﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace OpSatPlan.LexerParser
{
    public class IdentifierProcessor
    {
        string mIdentifierFileName;
        private Domain mDomain;
        public IdentifierProcessor(string idFileName, Domain domain)
        {
            this.mIdentifierFileName = idFileName;
            this.mDomain = domain;
        }

        public void BuildIdentifiers()
        {
            Domain domain;
            PddlLexer lexer;
            IdentifierParser idParser;
            TUVienna.CS_CUP.Runtime.Symbol root;

            // build domain
            lexer = new PddlLexer(new System.IO.StreamReader(this.mIdentifierFileName));
            idParser = new IdentifierParser(lexer);
            root = idParser.parse();
            ((IdentifierDefinitionNode)root.value).BuildIdentifiers(this.mDomain);
        }
    }
}